home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / PET / S-Super PET / (s)tl.d64 / SCROLL.ASM < prev    next >
Assembly Source File  |  2009-01-18  |  4KB  |  138 lines

  1. ;       Scroll         as of 03/24/84
  2. ;           'scroll' for bank $F
  3.  
  4. ; 'scroll' -- reconstructed from binary by T.M. Peterson
  5. ;                        6/19/83
  6.  
  7. ;  Altered 7/01/83 for better print & serial buffering
  8.  
  9. ;    "     7/06/83 for warm start after accid. lang. exit
  10.  
  11. ;    "     7/10/83 for STOP during RVS pause
  12.  
  13. ;  9/24/83  start FScroll--delete serial buffer.
  14. ; 11/20/83    "   GScroll
  15. ; 11/20/83   'Fixed' doubled lines in scroll freeze.
  16. ;  3/04/84  Tie together GScroll and P.Ruud's keyboard patch.
  17.  
  18.         xref    TGetCurs_,TGetChar_,ScrnDmpType
  19.         xref    PrintF_,ConBInt_,Ruud_key,Scroll_Stop,Insert,Altbffr
  20.  
  21.         xdef    scroll_init,scroll_conn,scroll_discon
  22.  
  23. norm_IRQ        equ     $DE0B   ;Normal SPET IRQ ROM routine
  24. trans           equ     $128    ;flag for kybd decode
  25.  
  26. ; Following code is assumed to be in bank-switched memory
  27. ; and therefore needs no protection from over-writing by
  28. ; user programs.
  29.  
  30. scroll_init     equ     *       ;Set up pointers for patches
  31.  
  32.         clr     Scroll_Stop     ;First clear flags
  33.         clr     Insert
  34.         clr     Altbffr
  35.         ldb     #1              ;Init. spec. key trans funct.
  36.         stb     trans
  37.  
  38.         ldy     #$600-6 ;Put pointer in unused part of vector table
  39.         sty     $5C7    ;Put pointer in table
  40.         ldd     #$BDB0  ; 'JSR $B0-'
  41.         std     ,y++
  42.         ldd     #$090F  ; '09 Bank 15'
  43.         std     ,y++
  44.         ldd     #Toutput_patch
  45.         std     ,y
  46.         lbsr    scrndmp_init    ; Find out what printer.
  47.         bsr     scroll_conn     ; Turn on patch
  48.  
  49.         CLR     $32     ;flag done
  50.  
  51.         ldd     #hello  ;print 'hello' msg
  52.         jmp     printf_
  53.  
  54. hello   fcb    12,10,10
  55.         fcc    "    --  S c r o l l  (Version 03/24/84) --  by T.M. Peterson"
  56.         fcb    $D,$D
  57.         fcc    "                       Now Activated."
  58.         fcb    $D,$D,0
  59.  
  60. scroll_conn     equ     *
  61.         ldb     #7      ;Set Toutput trap flag
  62.         stb     $585
  63.         sei             ;NO IRQ's right now.
  64.         jsr     Ruud_key ;Connect Paul's kybd routine
  65.         cli
  66.         rts
  67.  
  68. scroll_discon   equ     *
  69.         clr     $585    ;Clear Toutput flag
  70.         ldd     #norm_IRQ
  71.         std     $108    ;Clear bank-sw. IRQ
  72.         rts
  73.  
  74. Toutput_patch   equ     *
  75.         ldb     3,s             ;Get char about to print
  76.         cmpb    #$D             ;Is CR?
  77.         if      eq
  78.           tst   Scroll_Stop     ;Flag set?
  79.           if    ne              ;yes
  80.             loop
  81.               tst Scroll_Stop
  82.             until eq            ;wait for flag cleared.
  83.           endif
  84.         endif
  85.         rts                     ;Go print char
  86.  
  87. scrndmp_init    equ     *
  88.         loop                    ;Most of us will substitute:
  89.           ldd   #prquery        ;
  90.           jsr   printf_         ;       ldb #our_type
  91.           jsr   tgetchar_       ;       stb ScrnDmpType
  92.           cmpb  #$d             ;       rts
  93.           if    eq              ;
  94.             clrb                ;   for the code at left.
  95.           else
  96.             pshs b
  97.             loop
  98.              jsr tgetchar_
  99.              cmpb #$d
  100.             until eq
  101.             puls b
  102.             subb #'0
  103.           endif
  104.           stb   ScrnDmpType
  105.           quif  eq
  106.           decb
  107.           quif  eq
  108.           decb
  109.         until   eq
  110.         ldd     #lfquery
  111.         jsr     printf_
  112.         jsr     tgetchar_
  113.         cmpb    #'y
  114.         if      eq
  115.           lda   #$80
  116.         else
  117.           clra
  118.         endif
  119.         ora     ScrnDmpType
  120.         sta     ScrnDmpType
  121.         loop
  122.           cmpb  #$d
  123.           quif  eq
  124.           jsr   tgetchar_
  125.         endloop
  126.         rts
  127.  
  128. prquery equ     *
  129.         fcc     "%nScreen dumps to: 0) 'ieee4', 1) 'printer', or 2) 'serial'%n"
  130.         fcc     "(0/1/2/CR=0)?"
  131.         fcb     $d,0
  132.  
  133. lfquery equ     *
  134.         fcc     "%nRequires linefeeds (y/n/CR=n)?"
  135.         fcb     $d,0
  136.  
  137.         end
  138.